home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / tex / lindner / metafont / inputs / plain.lzs / ATARI.MF next >
Encoding:
Text File  |  1992-02-03  |  10.2 KB  |  284 lines

  1. % ATARI.MF by Lutz Birkhahn, February 3, 1992.
  2. %
  3. % A file to be loaded after "plain.mf". It defines the parameters for some
  4. % printers that are often used with the Atari ST. Many thanks to Stefan Lind-
  5. % ner and many others, who provided me with so many mode_defs. I would never
  6. % have been able to design them all by myself.
  7. %
  8. % History:
  9. %
  10. % Last update on February 3, 1992:
  11. %   NEChi mode corrected (previously used a wrong resolution)
  12. % August 7, 1991:
  13. %   Update to modes.mf version 0.7
  14. % July 18, 1991:
  15. %   Inclusion of Karl Berry's modes.mf and some local modifications that I
  16. %   hope to be included in modes.mf some time.
  17. % First version created on January 14, 1988.
  18.  
  19. %--------------------------- modes.mf --------------------------------
  20.  
  21. input modes.mf % That's Karl Berry's "official" modes file
  22.  
  23. % correcting some errors in modes.mf:
  24.  
  25. truemac := MacTrueSize;               % was MacTrue
  26. linothreelo := LinotypeOneZeroZero;   % was LinotypeOneZero
  27. linosuper := LinotypeThreeZeroZeroHi; % was LinotypeThreeZeroZero
  28. linothree := LinotypeThreeZeroZeroHi; % was LinotypeThreeZeroZero
  29.  
  30. % exchanged the two lines, since the *first* value overrides any following
  31. % values, so the special mode_param has to come before the general CanonCX_.
  32. %
  33. mode_def NEChi =                        % NEC at 360dpi
  34.   mode_param (pixels_per_inch, 360);
  35.   CanonCX_;
  36. enddef;
  37.  
  38.  
  39. %----------------------- corrected drawdot ---------------------------
  40. %
  41. % The drawdot macro was corrected due to Harald B\"ogeholz' and Eber-
  42. % hard Mattes' mail and DEK's confirmation in the April'91 bug report.
  43. %
  44. % The correction now makes drawdot behave in the same way as the draw
  45. % macro, namely to not transform the pen shape if currenttransform is
  46. % not the identity. You can see the difference by saying e.g.
  47. %
  48. %    screenstrokes; pickup pencircle xscaled 10 yscaled 50;
  49. %    currenttransform := identity slanted 1/4;
  50. %    draw (100,100); drawdot (50,50);
  51. %
  52. % draw gives a vertical pen, while drawdot slants the pen too, which is
  53. % false according to DEK's comment on page 145 of the MFbook stating that
  54. % ``the pen nib [...] was not slanted when currenttransform was changed.''
  55. %
  56. def drawdot expr z = if unknown currentpen_path: def_pen_path_ fi
  57.  addto_currentpicture contour
  58.   currentpen_path shifted (z.t_) withpen penspeck enddef;
  59. % was:  currentpen_path shifted z.t_ withpen penspeck enddef;
  60.  
  61. %---------------------- changed mode_setup ---------------------------
  62. %
  63. % I've modified the original (and Karl Berry's) version of mode_setup
  64. % to make the specialties for write white printing engines transparent
  65. % to the user. You can now define 'write_white_engine=true' in any mode_def.
  66. % The default value is false, so the other mode_def's don't need any change.
  67. % Advantage of this change: other files such as cmbase.mf (or actually
  68. % cmlocal.mf) can ask whether they have to produce a font for a write white
  69. % engine by inserting the test 'if write_white_engine: ... else: ... fi',
  70. % so you don't need neither a special cmww.bse nor is this approach restric-
  71. % ted only to the mode_setup macro.
  72. %
  73. % The second change is a warning if the mode variable is still unknown at
  74. % the time of mode_setup. The original version silently switched to proof
  75. % mode, causing many irritations to the users if they misspelled a mode or
  76. % used a mode not (yet) specified in this file or in the file they used
  77. % while building the plain base file.
  78. %
  79. def mode_setup =
  80.  warningcheck:=0;
  81.  if unknown mode:
  82.   message
  83.    "Warning: unknown or unspecified mode has been replaced by proof mode";
  84.   mode=proof; fi
  85.  numeric aspect_ratio; transform currenttransform;
  86.  boolean write_white_engine; % ww change by LB
  87.  scantokens if string mode:("input "&mode) else: mode_name[mode] fi;
  88.  if unknown mag: mag=1; fi
  89.  if unknown aspect_ratio: aspect_ratio=1; fi
  90.  if unknown write_white_engine: write_white_engine=false; fi % ww change by LB
  91.  displaying:=proofing;
  92.  pixels_per_inch:=pixels_per_inch*mag;
  93.  if aspect_ratio=1: let o_=\; let _o_=\
  94.  else: def o_=*aspect_ratio enddef; def _o_=/aspect_ratio enddef fi;
  95.  fix_units;
  96.  scantokens extra_setup; % the user's special last-minute adjustments
  97.  currenttransform:=
  98.   if unknown currenttransform: identity else: currenttransform fi
  99.    yscaled aspect_ratio;
  100.  clearit;
  101.  pickup pencircle scaled (.4pt+blacker);
  102.  warningcheck:=1; enddef;
  103.  
  104. %----------------------- changed mode_def ----------------------------
  105. %
  106. % The following change to the mode_def macro (found in the amsmodes.mf
  107. % file distributed by the AMS) allows the user to switch to an undefined
  108. % mode (e.g. in the command line) that will be defined some time later,
  109. % for example in a local file that is not compiled into the base file.
  110. % But anyway, if the mode_setup macro is called, the mode must be fixed:
  111.  
  112. % ``We make the following modification of "mode_def" from PLAIN in order
  113. % to accomodate modes not preloaded in MF.  Even though mode had been
  114. % set dependently on the command line (as with mode=talaris), when
  115. % mode_def came along to define "talaris" the assignment operator
  116. % (:=) wiped out that dependency and left mode hanging and undefined
  117. % when mode_setup was called.  We simply add a test to see whether
  118. % "mode" has been set to the mode being defined.
  119.  
  120. % Furthermore, if mode was set to a mode which was preloaded and
  121. % that mode was re-defined at run-time, the value of mode would
  122. % only pick up the old definition.  So, for the other case,
  123. % that the mode being defined already has a numeric realization,
  124. % we avoid redefining that mode's (behind-the-scenes) value.
  125.  
  126. % We also add the following macros to enable conditional "and"
  127. % and "or".  See The MEtafontBook, pp.288-9
  128.  
  129. def cand(text q) = startif true q else: false fi enddef;
  130. def cor(text q) = startif true true else: q fi enddef;
  131. tertiarydef p startif true = if p: enddef;
  132.  
  133. def mode_def suffix $ =
  134.  if known($) cand
  135.    (numeric $ cand
  136.    ($<number_of_modes cand
  137.    (mode_name[$] = (str $ & "_")))):
  138.  else: if known(mode-$) cand (unknown mode): mode:= fi
  139.        $:=incr number_of_modes;
  140.        mode_name[$]:=str$ & "_";
  141.  fi
  142.  expandafter quote def scantokens mode_name[$] enddef;
  143.  
  144. %------------------------ better penpos ------------------------------
  145. %
  146. % See the pos/penpos discussion in cmlocal.mf.
  147. %
  148. def penpos_error(expr b) =
  149.  hide(
  150.   errhelp "Perhaps you used a mode with blacker < 0? Continue, and I'll do my best.";
  151.   errmessage "Bad penpos: pen breadth of " & decimal b
  152.              & " has been replaced by 1";
  153.   errhelp "")
  154. enddef;
  155.  
  156. vardef penpos@#(expr b,d) =
  157.  (x@#r-x@#l,y@#r-y@#l)=(
  158.    if known b: if b<=0: penpos_error(b) 1 else: b fi else: b fi
  159.    ,0) rotated d; 
  160.  x@#=.5(x@#l+x@#r); y@#=.5(y@#l+y@#r) enddef;
  161.  
  162.  
  163. %---------------- local modifications for the Atari ------------------
  164.  
  165. base_version:=base_version&"/Atari";
  166.  
  167. screen_rows:=400; screen_cols:=640;
  168. % Change as needed if you use another screen or graphics window resolution.
  169. % You might also consider providing an own version of the openit macro to
  170. % change the origin of the standard window "it". (I speak of _METAFONT_'s
  171. % windows, not GEM's!)
  172.  
  173. %------------------------ various mode_defs --------------------------
  174.  
  175. % stscreen mode: for the ATARI ST `high resolution' screen SM124
  176. stscreen := AtariSMOneTwoFour;
  177.  
  178. % stlaser mode: to generate fonts for the Atari ST laser printer SLM804
  179. mode_def stlaser =
  180.  pixels_per_inch:=300;
  181.  blacker:=-.25;
  182.  fillin:=.5;
  183.  o_correction:=0;
  184.  write_white_engine:=true;  % Use the file cmlocal.mf (loaded at the end of
  185.                             % cmbase.mf) to benefit of this boolean variable.
  186.  mode_common_setup_;
  187. enddef;
  188.  
  189. % stlaseralter mode: alternate mode_def for problem fonts on the SLM804.
  190. % Use this one if you get a lot of "bad penpos" or "strange path" errors
  191. % from METAFONT. These error messages are due to the negative value of
  192. % blacker, which is discouraged by Don Knuth, but looks best (in my opinion)
  193. % on the Atari laser printer and probably some other write-white lasers.
  194. %
  195. % With the new penpos definition this mode should become unnecessary.
  196. mode_def stlaseralter =
  197.  stlaser_;                     % same as stlaser mode, except:
  198.  blacker:=0;                   % "normal blackness"
  199. enddef;
  200.  
  201. % HP Deskjet mode: to generate fonts for the HP-Deskjet printer
  202. % An alternative would be the HPDeskJet mode from modes.mf. Anyone to test?
  203. mode_def hp_deskjet =
  204.  pixels_per_inch:=300;
  205.  blacker:=-0.2;
  206.  fillin:=.2;
  207.  o_correction:=.2;
  208.  mode_common_setup_;
  209. enddef;
  210.  
  211. % HP Laserjet mode: to generate fonts for the HP-Laserjet printer
  212. % The LaserJet has a Canon CX print engine
  213. hp_laserjet := CanonCX;
  214.  
  215. % canon_bj mode: to generate fonts for the Canon BJ-130 inkjet printer
  216. mode_def canon_bj =
  217.  pixels_per_inch:=360;
  218.  blacker:=.2;
  219.  fillin:=.1;
  220.  o_correction:=.5;
  221.  mode_common_setup_;
  222. enddef;
  223.  
  224. % Star NL-10 mode: to generate fonts for the star NL-10 printer
  225. starnl := StarNLOneZero;
  226.  
  227. % The mode_def's for the NEC P6 are from Michael Mies (Germany)
  228. % psix_low mode: to generate fonts for the NEC P6 printer (180 dpi)
  229. % See also mode NEC in modes.mf!
  230. mode_def psix_low =
  231.  pixels_per_inch:=180;
  232.  blacker:=0.1;
  233.  fillin:=.2;
  234.  o_correction:=.6;
  235.  mode_common_setup_;
  236. enddef;
  237.  
  238. % psix_medium mode: to generate fonts for the NEC P6 printer (360x180)
  239. mode_def psix_medium =
  240.  pixels_per_inch:=360;
  241.  blacker:=0;
  242.  fillin:=.2;
  243.  o_correction:=.6;
  244.  aspect_ratio:=180/360;
  245.  mode_common_setup_;
  246. enddef;
  247.  
  248. % psix_high mode: to generate fonts for the NEC P6 printer (360 dpi)
  249. % Have you seen the NEChi mode in modes.mf?
  250. mode_def psix_high =
  251.  pixels_per_inch:=360;
  252.  blacker:=-.75;
  253.  fillin:=.2;
  254.  o_correction:=.75;
  255.  mode_common_setup_;
  256. enddef;
  257.  
  258. % citizen_low mode: to generate fonts for the Citizen C120D printer (120x144)
  259. mode_def citizen_low =
  260.  pixels_per_inch:=120;
  261.  blacker:=0;
  262.  fillin:=0;
  263.  o_correction:=0;
  264.  aspect_ratio:=144/120;
  265.  mode_common_setup_;
  266. enddef;
  267.  
  268. % epsonmx mode: to generate fonts for the Epson MX82 FT printer
  269. mode_def epsonmx =
  270.  pixels_per_inch:=120;
  271.  blacker:=0;
  272.  fillin:=0;
  273.  o_correction:=0;
  274.  aspect_ratio:=216/120;
  275.  mode_common_setup_;
  276. enddef;
  277.  
  278. % epsonfx mode: to generate fonts for the Epson FX-80 printer
  279. % Let's take the "official" name from modes.mf
  280. epsonfx := EpsonMXFX;
  281.  
  282. localfont:=stscreen;     % the mode most commonly used to make fonts
  283.  
  284.